package com.xidian.zhiancloud.service.dangerWorkTicket.WorkTicket;

import com.baomidou.mybatisplus.extension.service.IService;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import com.xidian.zhiancloud.dao.workTicket.TemplateSourceMapper;
import com.xidian.zhiancloud.model.dangerWorkTicket.TemplateSource;
import com.xidian.zhiancloud.ticketTemplate.ticketContentRisk.*;
import org.springframework.stereotype.Service;



@Service
public class TemplateSourceService extends ServiceImpl<TemplateSourceMapper, TemplateSource> implements IService<TemplateSource> {


    public Boolean templateSourceInit() {
        //注入所有的template
        TemplateSource fire = new TemplateSource();
        fire.setContent(Fire.fireRiskStr());
        fire.setName("动火作业票");
        fire.setType(1);
        save(fire);

        TemplateSource restrictedSpace = new TemplateSource();
        restrictedSpace.setContent(RestrictedSpace.restrictedRiskStr());
        restrictedSpace.setName("受限空间作业票");
        restrictedSpace.setType(2);
        save(restrictedSpace);

        TemplateSource highSpace = new TemplateSource();
        highSpace.setContent(HighSpace.HighSpaceRiskStr());
        highSpace.setName("高处作业票");
        highSpace.setType(3);
        save(highSpace);

        TemplateSource hoist = new TemplateSource();
        hoist.setContent(Hoist.hoistRiskStr());
        hoist.setName("吊装作业票");
        hoist.setType(4);
        save(hoist);

        TemplateSource turnoff = new TemplateSource();
        turnoff.setContent(Turnoff.turnoffRiskStr());
        turnoff.setName("断路作业票");
        turnoff.setType(5);
        save(turnoff);

        TemplateSource groundBreaking = new TemplateSource();
        groundBreaking.setContent(GroundBreaking.groundBreakingRiskStr());
        groundBreaking.setName("动土作业票");
        groundBreaking.setType(6);
        save(groundBreaking);

        TemplateSource temporaryPower = new TemplateSource();
        temporaryPower.setContent(TemporaryPower.temporaryPowerRiskStr());
        temporaryPower.setName("临时用电作业票");
        temporaryPower.setType(7);
        save(temporaryPower);

        TemplateSource blindBoardBlockUp = new TemplateSource();
        blindBoardBlockUp.setContent(BlindBoardBlockUp.BlindBoardBlockUpRiskStr());
        blindBoardBlockUp.setName("盲板抽堵作业票");
        blindBoardBlockUp.setType(8);
        save(blindBoardBlockUp);

        TemplateSource raysHarm = new TemplateSource();
        raysHarm.setContent(RaysHarm.raysHarmRiskStr());
        raysHarm.setName("射线探伤安全作业票");
        raysHarm.setType(9);
        save(raysHarm);

        return Boolean.TRUE;
    }


}
